package com.example.taobaou.utils;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

/**
 * 隐藏显示软键盘的工具类
 */
public class KetboardUtil {
    /**
     *隐藏键盘
     * @param context
     * @param view
     */
    public static void hide(Context context , View view){
        InputMethodManager im = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
        im.hideSoftInputFromWindow(view.getWindowToken(),0);
    }

    /**
     * 弹出键盘
     * @param context
     * @param view
     */
    public static void show(Context context , View view){
        InputMethodManager im = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
        im.showSoftInput(view,0);
    }
}
